//888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
//
//	File		 :	mfc_stdcpp.h
//	Contents	 :	Source file for functions which link MFC functions with
//						ANSI C++standard library
//	Creation Date:	1/1/20100
//	Last Modified:	1/1/20100	lg, Y2K bug shows that these lines are machine generated
//	tabs width	 :	every 4 characters
//
//888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
#if !defined(NONMFC_STDCPP_H)
#define NONMFC_STDCPP_H


#include <string>
#include <iostream>
#include <vector>
#include "binarystream.h"



bool LoadString(std::string& str, unsigned resId);

struct CColourref
{
	CColourref(){}
	CColourref(unsigned c) : l(c){}
	unsigned l;
	unsigned for_HTML() const;
	unsigned red() const	{return 0x000000FF & (l >>  16);}
	unsigned green() const	{return 0x000000FF & (l >>  8);}
	unsigned blue() const	{return 0x000000FF & (l);}
	bool operator < (CColourref o) const {return l < o.l;}
};

inline bool operator ==(const CColourref& a, const CColourref&b)
{
	return a.l== b.l;
}

inline bool operator !=(const CColourref& a, const CColourref&b)
{
	return a.l!= b.l;
}
// the cast will be optimized out of existence and is only
//	used for choosing the right function
std::ostream& operator << (std::ostream& os, CColourref c);

template<class T, class C> inline
CBinary_basic_ostream<T,C>& operator << (
CBinary_basic_ostream<T,C>& os, const CColourref& c)
{
	return os << c.l;
}

template<class T, class C> inline
CBinary_basic_istream<T,C>& operator >> (
CBinary_basic_istream<T,C>& is,  CColourref& c)
{
	return is >> c.l;
}


inline unsigned CColourref::for_HTML() const
{return 0x10000000 | (red() << 16) | (green() << 8) | blue() ;}
/*|
| inline size_t __stl_hash_string(const char* __s)
| {
|   unsigned long __h = 0;
|   for ( ; *__s; ++__s)
|     __h = 5*__h + *__s;
|
|   return size_t(__h);
| }
|
| __STL_TEMPLATE_NULL struct hash<char*>
| {
|   size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
| };
|
| __STL_TEMPLATE_NULL struct hash<const char*>
| {
|   size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
| };
*/


#endif
